package com.warm.base.design.b_template;

/**
 * @Date: 2019/11/21 14:40
 * @Author: LChuang
 * @Description:
 */
public abstract class AbstractClass {

    /**
     * define final, avoid child class Override
     */
    protected final void start(){
        System.out.println("AbstractClass start");
    }

    /**
     * need child Override --> do implement
     */
    protected void implement(){
        System.out.println("AbstractClass step2");
    }

    /**
     * define final, avoid child class Override
     */
    public final void templateMethod(){
        this.start();
        this.implement();
    }
}
